import React, { Component } from 'react';
import { render } from 'react-dom';


let _this;
class Home extends React.Component {

    constructor(...args) {
        super(...args);

        _this = this;
        this.state = { str: '初始化的str' };
    }

    fn() {
        let x = $("#in1").val();

        _this.setState({ str: x });

    }

    render() {
        console.log("render");
        return <div>
            <h1>{this.state.str}</h1>
            <h1>123456789</h1>
            <br />
            <br />
            <input id="in1" onChange={this.fn} />
        </div>;
    }

}

export default Home